home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / lisp / stk-3.002 / stk-3 / STk-3.1 / Contrib / STk-wtour / lessons / selection.stk < prev    next >
Encoding:
Text File  |  1995-12-13  |  373 b   |  14 lines

  1. ;; X Selection
  2.  
  3. (pack 
  4.    [label '.lab :text "Selection is:" :anchor "w"]
  5.    [text '.t :relief "raised" :bd 1 :height 15]
  6.    [button '.b1 :text "Get Selection" 
  7.            :command (lambda ()
  8.                ;; Clear text buffer
  9.                (.t 'delete "1.0" "end")
  10.                ;; Insert selection if it exists
  11.                (unless (catch (selection 'get))
  12.                    (.t 'insert "1.0" (selection 'get))))])
  13.  
  14.